package com.tjbank.cssys.web.controller;

import java.sql.DriverManager;

public class TestController {

    public static void main(String[] args) {
        
        String driverName = "oracle.jdbc.driver.OracleDriver";
        String dbURL = "jdbc:oracle:thin:@127.0.0.1:1521:ORCL";
        String userName = "system";
        String Pwd = "system";
        
        try {
            Class.forName(driverName);
            System.out.println("加载驱动成功！");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("加载驱动失败！");
        }
        try {
            DriverManager.getConnection(dbURL, userName, Pwd);
            System.out.println("连接数据库成功！");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.print("数据库连接失败！");
        }
    }
}
